package com.jewelry.service.impl;

import java.util.ArrayList;
import java.util.List;

import com.jewelry.dao.IPackagesDAO;
import com.jewelry.service.IPackagesService;
import com.jewelry.vo.StatisticsVO;

public class PackagesServiceImpl implements IPackagesService {
	
	public IPackagesDAO getPackagesDAO() {
		return packagesDAO;
	}

	public void setPackagesDAO(IPackagesDAO packagesDAO) {
		this.packagesDAO = packagesDAO;
	}

	private IPackagesDAO packagesDAO;

	//============================================================
	
	@Override
	public List<StatisticsVO> getGroupByPackageState() {
		List<StatisticsVO> temp = new ArrayList<StatisticsVO>(5);
		StatisticsVO vo = null;
		for(int i=1;i<=8;i++){
			vo = new StatisticsVO();
			vo.setType(i);
			temp.add(vo);
		}
		List<StatisticsVO> list = packagesDAO.getGroupByPackageState();
		for(StatisticsVO svo:temp ){
			if(!list.contains(svo)){
				list.add(svo);
			}
		}
		return list;
	}
	
	
	

}
